/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.qdu.service.impl;

import com.qdu.dao.JournalDao;
import com.qdu.dao.impl.JournalDaoImpl;
import com.qdu.entity.Journal;
import com.qdu.service.JournalService;
import java.util.List;

/**
 * 实现JournalService接口定义的业务逻辑
 * @author Zom
 */
public class JournalServiceImpl implements JournalService{
    JournalDao journalDao=new JournalDaoImpl();

    @Override
    public int publishJournal(Journal jon) {
        return journalDao.addJournal(jon);
    }

    @Override
    public List<Journal> searchJournalByKeyword(String keyword) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public Journal searchJournalById(String Jid) {  
        return journalDao.getJournalById(Jid);
    }

    @Override
    public int modifyJournal(Journal jon) {
        return journalDao.editJournal(jon);
    }

    @Override
    public int deleteJournal(String Jid) {
        return journalDao.delJournalById(Jid);
    }

    @Override
    public List<Journal> findAllJournalInfo() {
        return journalDao.getAllJournal();
    }

    @Override
    public List<Journal> findJournalByKeyword(String keyword) {
        return journalDao.getJournalByKeyword(keyword);
    }

    @Override
    public List<Journal> findJournalById(int id) {
        return journalDao.getJournalById(id);
    }
}
